//
//  DHCustomerViewController.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/1/23.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHCustomerViewController.h"
#import <QIYU_iOS_SDK/QYSDK.h>

@interface DHCustomerViewController ()

@end

@implementation DHCustomerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
    [backButton setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(onBack:) forControlEvents:UIControlEventTouchUpInside];
    
    QYSource *source = [[QYSource alloc] init];
    source.title =  @"Dresshere";
    source.urlString = @"https://8.163.com/";
    QYSessionViewController *sessionViewController = [[QYSDK sharedSDK] sessionViewController];
    sessionViewController.sessionTitle = @"dresshere";
    sessionViewController.source = source;
    sessionViewController.hidesBottomBarWhenPushed = YES;
    sessionViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    [self.navigationController pushViewController:sessionViewController animated:NO];
}

- (void)onBack:(id)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
